package com.ruoyi.quartz.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.quartz.domain.BaseCompany;
import com.ruoyi.quartz.service.IBaseCompanyService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/base/company")
public class BaseCompanyController extends BaseController {

    @Resource
    private IBaseCompanyService iBaseCompanyService;

    @GetMapping(value = "/{company_id}")
    public AjaxResult getInfo(@PathVariable("company_id") Integer company_id)
    {
        return AjaxResult.success(iBaseCompanyService.selectCompanyById(company_id));
    }

    @PutMapping
    public AjaxResult edit(@Validated @RequestBody BaseCompany baseCompany)
    {
        return toAjax(iBaseCompanyService.updateCompany(baseCompany));
    }
}
